Skip to content

Expose concrete types#20

Merged
freeformz merged 3 commits intomainfrom
ffz/ExposeImplementationTypes
Mar 28, 2025
Merged

Expose concrete types#20
freeformz merged 3 commits intomainfrom
ffz/ExposeImplementationTypes

Conversation

@freeformz
Copy link
Owner

  • Renames
    • func Map to func MapBy
    • func New to func NewMap
    • func NewFrom to func NewMapFrom
    • func NewWith to func NewMapWith
  • Set types are now exported, so that ...
  • Concrete types can be used in structs and json.Unmarshaled to.
    • sets.Map (basic set type)
    • sets.Locked (basic locked set type)
    • sets.Ordered (basic ordred set type)
    • sets.LockedOrdered (basic locked+ordered set type)
    • sets.SyncMap (sync.Map based set type)
  • Added more JSON tests, especially for above

#minor

* Renames
  * func Map to func MapBy
  * func New to func NewMap
  * func NewFrom to func NewMapFrom
  * func NewWith to func NewMapWith
* Set types are now exported, so that ...
* Concrete types can be used in structs and json.Unmarshaled to.
  * sets.Map (basic set type)
  * sets.Locked (basic locked set type)
  * sets.Ordered (basic ordred set type)
  * sets.LockedOrdered (basic locked+ordered set type)
  * sets.SyncMap (sync.Map based set type)
* Added more JSON tests, especially for above

#minor
@freeformz freeformz requested a review from Copilot March 28, 2025 04:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR exposes concrete types and renames several constructors and utility functions to improve discoverability and type safety. Key changes include:

  • Renaming functions (e.g. Map → MapBy, New → NewMap, etc.) and exporting concrete types.
  • Updating JSON marshaling/unmarshaling and test examples to use the new names.
  • Adding new tests to verify JSON behavior for the updated set types.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sync.go Exports SyncMap and updates all sync-based set functions
set_test.go Updates test cases to use the new constructor and function names
set.go Renames Map to MapBy and uses NewMap for instantiation
ordered.go Exports Ordered type and adjusts return types accordingly
map.go Exports Map type and updates associated constructor functions
locker.go Adds a new locker interface for concurrency abstraction
locked_ordered.go Exports LockedOrdered and revises locking semantics
locked.go Exports Locked type and refines JSON unmarshaling logic
examples_test.go Updates examples to reflect the new naming conventions
README.MD Updates documentation to refer to MapBy instead of Map
CHANGELOG.MD Documents renames and new features in the changelog

freeformz and others added 2 commits March 27, 2025 21:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@freeformz freeformz enabled auto-merge (squash) March 28, 2025 04:26
@freeformz
Copy link
Owner Author

That was interesting. Never did a "copilot review" before.

@freeformz freeformz merged commit dbda1b1 into main Mar 28, 2025
7 of 9 checks passed
@freeformz freeformz deleted the ffz/ExposeImplementationTypes branch March 28, 2025 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant